import http from '@/components/common/tui-request'


//新增施工日志
export const addWorkRecord = (projectId,data) => {
	return http.request({
		url: `/work-record/addWorkRecord/${projectId}`,
		data:data,
		method: 'POST',
	});
};

//获取施工日志列表
export const getWorkRecordList = (projectId,page,limit) => {
	return http.request({
		url: `/work-record/getWorkRecordList/${projectId}/${page}/${limit}`,
		method: 'GET',
	});
};

//根据id获取施工日志详情
export const selectWorkRecordInfoById = (id) => {
	return http.request({
		url: `/work-record/selectWorkRecordInfoById?id=${id}`,
		method: 'GET',
	});
};

//根据id获取施工日志数据回显
export const getWorkRecordById = (id) => {
	return http.request({
		url: `/work-record/getWorkRecordById?id=${id}`,
		method: 'GET',
	});
};

//删除指定施工日志
export const deleteWorkRecord = (id) => {
	return http.request({
		url: `/work-record/deleteWorkRecord?id=${id}`,
		method: 'DELETE',
	});
};

//编辑施工日志
export const updateWorkRecord = (data) => {
	return http.request({
		url: `/work-record/updateWorkRecord`,
		data:data,
		method: 'PUT',
	});
};

//获取分部分项下拉列表
export const getSysSubsectionManageList = () => {
	return http.request({
		url: `/sys-subsection/getSysSubsectionManageList`,
		method: 'GET',
	});
};

//获取当前企业参建人员下拉列表信息
export const projectUserManageList = (projectId,unitsId) => {
	return http.request({
    url:`/project-user/projectUserManageList?projectId=${projectId}&unitsId=${unitsId}`,
    method: 'GET',
  });
};

//获取树形计划列表
export const getPlanTreeSelect = (projectId) => {
	return http.request({
    url:`/project-plan/getPlanTreeSelect/${projectId}`,
    method: 'GET',
  });
};

//根据所属阶段获取档案目录树形下拉列表
export const getArchiveDirTreeSelect = (projectId,stage) => {
	return http.request({
    url:`/project-archive-dir/getArchiveDirTreeSelect/${projectId}?stage=${stage}`,
    method: 'GET',
  });
};